import React from 'react';
import { axconst } from '@/shared/axconst';
import { AxStandardCardFilterType } from '@/components/AxList/AxStandardLayout/data.d';
import { AxStandardWideList } from '@/components/AxList/AxStandardWideList';
import { axurl } from '@/shared/axurl';
import { AxColumnEnum } from '@/components/AxList';

const url = axurl.lab.list.record;
const Index: React.FC<any> = props => {

    /** 配置列 */
    const columns = [
        {
            title: '流程ID',
            dataIndex: 'recordId',
            width: axconst.width.flowId,
        },
        {
            title: '标题',
            dataIndex: 'title',
            width: axconst.width.flowTitle,
        },
        {
            title: '采购主体名称',
            dataIndex: 'labName',
            width: axconst.width.labName,
        },
        {
            title: '部门名称',
            dataIndex: 'deptName',
            width: axconst.width.deptName,
        },
        {
            title: '状态',
            dataIndex: 'workFlowState',
            width: axconst.width.four,
            render: (v: any) => AxColumnEnum({ enumName: 'workFlowState', value: v }),
        },
        {
            title: '申请人',
            dataIndex: 'userName',
            width: axconst.width.threeonly,
        },
        {
            title: '申请人电话',
            dataIndex: 'mobile',
            width: axconst.width.phone,
        },
        {
            title: '申请时间',
            dataIndex: 'createdTime',
            width: axconst.width.time,
        },
        {
            title: '申请备注',
            dataIndex: 'description',
            width: axconst.width.time,
        },
    ];

    const filter: AxStandardCardFilterType[] = [{
        icon: 'plus-circle',
        text: '审核中',
        field: 'isManager',
        value: true,
    }, {
        icon: 'minus-circle',
        text: '已通过',
        field: 'isManager',
        value: false,
    }]

    return (
        <>
            <AxStandardWideList
                url={url}
                columns={columns}
                filter={filter}
            />
        </>
    );
};

export default Index;
